package cn.com.headfree.history;

import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.boot.web.server.WebServerFactory;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

/**  
 * @Title  WebConfiguration.java   
 * @Package cn.com.headfree.history   
 * @Description springBoot的history模式
 * @author yangwang 
 * @date  2019年11月11日 上午10:53:18
 */
@SuppressWarnings("rawtypes")
@Component
public class WebConfiguration implements WebServerFactoryCustomizer {

	@Override
	public void customize(WebServerFactory factory) {
		((ErrorPageRegistry) factory).addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/index.html"));
	}

}
